package com.whmnx.chitchat.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.classic.adapter.BaseAdapterHelper;
import com.classic.adapter.CommonRecyclerAdapter;
import com.whmnx.chitchat.R;
import com.whmnx.chitchat.bean.DepartmentDean;
import com.whmnx.chitchat.bean.FileBean;

import java.util.ArrayList;
import java.util.List;

/**
 * author : huang
 * date   : 2020/7/27 0027 17:31
 * version: 1.0
 * @author Administrator
 */
public class FileAdapter extends CommonRecyclerAdapter<FileBean> {
    private Context context;
    private List<Boolean> alreadyLikeList = new ArrayList<>();
    private ImageView view;


    public FileAdapter(Context context) {
        super(context, R.layout.item_list_file);
        this.context = context;
    }


    @Override
    public void onUpdate(BaseAdapterHelper helper, FileBean item, int position) {
        String file = item.getChatRecord_Content();
        if (file.contains("##")){
            String[] strings = file.split("##");
            if (strings.length > 1)helper.setText(R.id.tv_name,strings[1]);
            if (strings.length > 2)helper.setText(R.id.tv_phone,strings[2]);
        }else {
            helper.setText(R.id.tv_name,file);
        }
        helper.setText(R.id.tv_time, (String) item.getCreateTime());
    }
}
